home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / Prograph Classic 2.6.1 / Examples / Sound Goodies / Sound Goodies Read Me next >
Encoding:
Text File  |  1995-09-28  |  2.6 KB  |  46 lines  |  [TEXT/ttxt]

  1. Example:                        Sound Goodies
  2. Written by:                    Garth Smedley, Pictrorius Incorporated
  3. Updated for 2.6.1 by:            The Tech Support Team, Pictorius Incorporated
  4.  
  5. Contents:        Sound Goodies.pgs
  6.                        Sound Goodies Read Me
  7.  
  8. Needs Prograph Extensions:
  9. The default configuration of your 'Prograph Extensions' folder, plus:
  10. The following file should be moved back one level from the 'Prograph Extensions:Extra Toolbox' folder into the 'Prograph Extensions' folder (note that Prograph Classic WILL NOT find extension files in subfolders of the 'Prograph Extensions' folder):
  11.         -Sound
  12.  
  13. Voice is a fairly simple class which allows you to play sampled sounds at different frequencies. By creating multiple instances of Voice and using the Synchronize method, you can play up to four Voices simultaneously. 
  14.  
  15. Voice scratches the surface of the Macintosh Sound Manager. The Voice class will get you started — look at chapter 22 of Inside macintosh Volume VI for the full story.
  16.  
  17. The Voice class requires system 6 or later.
  18.  
  19. How to Use the Voice Class
  20.  
  21. Create an instance of Voice and call its Start method, when you are finished with a Voice call its Finish method.
  22.  
  23. The Install method tells a voice which sampled sound it should use. It inputs the resource id of a sampled sound resource. Use ResEdit to put sound resources into your Prograph source file.
  24.  
  25. The method Play Note plays the installed sampled sound at a given frequency for a given duration. Duration and frequency are of the following form:
  26.  
  27.     duration = ( 2000 / beats per second  ) * beats per note.
  28.     frequency = 1 (C#) to 127 (G - 10 octaves above 1).
  29.  
  30. The Pause method lets you store several notes (or other commands) in a Voice. They will wait there until you call the Voice's Resume method, then the notes will start playing. Pause and Resume are needed to synchronize Voices as described below.
  31.  
  32. The Synchronize method is tricky. It inputs a list of Voices to synchronize and the order of this list is important. Here's how to use Synchronize:
  33.  
  34.     1. Call Pause for all the Voices you wish to synchronize.
  35. 2. Call Synchronize. (The first input should be one of the Voices in the list.)
  36.     3. Call Play Note  to store a bunch of notes in each Voice.
  37. 4. Call Resume for each Voice. 
  38.  
  39. You MUST Resume the Voices in the same order as they appear in the synchronization list AND you must not Finish any of the Voices before all have been resumed. YOU CAN HANG YOUR MACHINE! Be sure to save your code before testing it.
  40.  
  41. There are more sophisticated ways to synchronize Voices — see Inside Macintosh.
  42.  
  43. Have Fun!
  44.     Garth Smedley, 
  45.     Pictorius Incorporated
  46.